package com.yanqu.road.entity.enums;

/**
 * @author duli
 * @version 1.0
 * @date 2020/11/17 14:37
 * @Description 购买限购类型
 */
public enum eMallBuyLimitType implements ConvertibleEnum<Integer> {

    DAILY_LIMIT(1,"类型为活动期间今日积分达到即可购买"),

    ACTION_LIMIT(2,"类型为活动期间累计积分达到即可购买"),

    DAILY_STAGE_LIMIT(3,"类型为限购条件类，今日积分达到获得x次购买次数(阶段性)"),

    ACTION_STAGE_LIMIT(4,"类型为限购条件类，活动累计积分达到获得x次购买次数(阶段性)"),

    ACTIVITY_EXTEND(5, "活动扩展"),
    ;

    private int intValue;

    private String name;

    eMallBuyLimitType(int value, String name) {
        intValue = value;
        this.name = name;
    }

    @Override
    public Integer getIntValue() {
        return intValue;
    }

    @Override
    public String getName() {
        return name;
    }

    public static eMallBuyLimitType forValue(int value) {
        for (eMallBuyLimitType type : eMallBuyLimitType.values()) {
            if (type.intValue == value) {
                return type;
            }
        }
        return null;
    }
}
